/******************************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Ltd.                       */
/*                                                                            */
/*  NAME      = fix_response.c                                                */
/*  NOTE      = FXI 响应解析                                                  */
/*  DATE      = 2015/03/19 by zhengxd                                         */
/******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>

#include "fix_core.h"
#include "fix_comm.h"
#include "fix_fast.h"
#include "fix_broadcast.h"

extern void *g_p_apm_context;

/*******************************************************************************
*  FUNC     :  上报response
*  ARGS     :  p_st_conn(入力链接信息)
*           :  p_st_private(私有session数据)
*           :  p_st_hash_report(保存Frreport_data)
*  RTN      :  APM_L7_ANALYZE_FAIL      (FAIL)
*              APM_L7_ANALYZE_SUCC      (SUCC)
*  NOTE     :
*******************************************************************************/
static int __fix_report_resp(Conntrack *p_st_conn
                            , L7session_fix_private *p_st_private
                            , Frhash_header *p_st_hash_report)
{
    int i_ret = FR_SUCC;
    unsigned int ui_key_len = 0;
    unsigned int ul_server_time_us = 0;
    unsigned int ul_download_time_us = 0;
    unsigned int ui_name_key_len = 0;
    long l_resp_code = 0;
    char *p_err_msg = NULL;
    char *p_err_code = NULL;
    Frreport_data *p_st_report_data = NULL;
    Frreport_body_data *p_st_sess_body = NULL;
    L7session_fix *p_st_sess = p_st_private->p_st_sess;
    L7_req_fix *p_st_req = p_st_private->p_st_req;
    L7_resp_fix *p_st_resp = p_st_private->p_st_resp;
    Frlist_node *p_st_node = NULL;
    Fix_param *p_st_param = NULL;
    char *p_key = NULL;


    /* 创建report body */
    p_st_sess_body = frreport_body_new_l7(p_st_conn);
    if (p_st_sess_body == NULL)
    {
        return APM_L7_ANALYZE_FAIL;
    }
    /* 追加connection相关信息 */
    i_ret = frreport_body_l7_add_connInfo(p_st_sess_body, p_st_conn);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }

    /* add server */
    if (p_st_sess->p_user_name)
    {
        i_ret = frreport_body_l7_add_str(p_st_sess_body
                                         , APM_REPORT_KEY_SESSION_USERNAME
                                         , p_st_sess->p_user_name);
        if (i_ret != FR_SUCC)
        {
            frreport_body_free(&p_st_sess_body);
            return APM_L7_ANALYZE_FAIL;
        }
    }
    if (p_st_sess->st_login.tv_sec != 0
        || p_st_sess->st_login.tv_usec != 0)
    {
        /* add request start time */
        i_ret = frreport_body_l7_add_timeval(p_st_sess_body
                                            , APM_REPORT_KEY_SESSION_LOGIN_TIMESTAMP
                                            , &p_st_sess->st_login);
        if (i_ret != FR_SUCC)
        {
            frreport_body_free(&p_st_sess_body);
            return APM_L7_ANALYZE_FAIL;
        }
    }

    i_ret = frreport_body_l7_add_str(p_st_sess_body
                                    , APM_REPORT_KEY_TRANS_TITLE
                                    , p_st_req->p_msg_type ? p_st_req->p_msg_type : "");
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }

    /* add sequence id */
    i_ret = frreport_body_l7_add_ulong(p_st_sess_body
                                      , APM_REPORT_KEY_REQ_ID
                                      , p_st_req->ul_req_sequence);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }
    /* add isResponseRequired */
    i_ret = frreport_body_l7_add_int(p_st_sess_body
                                    , APM_REPORT_KEY_REQ_ISRESPREQUIRED, 1);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }
    /* add request start time */
    i_ret = frreport_body_l7_add_timeval(p_st_sess_body
                                        , APM_REPORT_KEY_REQ_START_TIMESTAMP
                                        , &p_st_req->st_start_timestamp);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }
    /* add request end time */
    i_ret = frreport_body_l7_add_timeval(p_st_sess_body
                                        , APM_REPORT_KEY_REQ_END_TIMESTAMP
                                        , &p_st_req->st_end_timestamp);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }
    /* add request message */
    i_ret = frreport_body_l7_add_str(p_st_sess_body, FIX_REPORT_KEY_REQ_MSG_TP
                                    , p_st_req->p_msg_type ? p_st_req->p_msg_type : "");
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }
    /* add send time */
    i_ret = frreport_body_l7_add_ulong(p_st_sess_body
                                      , APM_REPORT_KEY_REQ_SEND_TIME_US
                                      , p_st_req->ul_send_time_us);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }
    /* add send data bytes */
    i_ret = frreport_body_l7_add_ulong(p_st_sess_body
                                      , APM_REPORT_KEY_REQ_DATA_BYTES
                                      , p_st_req->ul_request_bytes);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }

    p_st_node = FRLIST_FIRST_NODE(&p_st_req->st_param);
    while (p_st_node)
    {
        p_st_param = (Fix_param *)FRLIST_GET_NODE_DATA(p_st_node);
        /* 做成key */
        if (p_st_param->p_tag_name)
        {
            ui_name_key_len = strlen(APM_REPORT_KEY_REQ) + 1 + 3 + 1 + strlen(p_st_param->p_tag_name) + 1;
            p_key = (char *)frmalloc(ui_name_key_len);
            if (p_key == NULL)
            {
                frreport_body_free(&p_st_sess_body);
                return APM_L7_ANALYZE_FAIL;
            }
            snprintf(p_key, ui_name_key_len, "%s.fix.%s", APM_REPORT_KEY_REQ, p_st_param->p_tag_name);
            i_ret = frreport_body_l7_add_str(p_st_sess_body, p_key
                           , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
            frfree(p_key);
            if (i_ret != FR_SUCC)
            {
                frreport_body_free(&p_st_sess_body);
                return APM_L7_ANALYZE_FAIL;
            }
            p_st_node = FRLIST_NEXT_NODE(p_st_node);
            continue;
        }

        switch (p_st_param->ui_tag)
        {
            case FIX_TAG_ACCOUNT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ACCOUNT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_AVGPX:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_AVGPX
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_BEGINSEQNO:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_BEGINSEQNO
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_BEGINSTRING:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_BEGINSTRING
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_BODYLENGTH:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_BODYLENGTH
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CHECKSUM:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CHECKSUM
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CLORDID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CLORDID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CUMQTY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CUMQTY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CURRENCY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CURRENCY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ENDSEQNO:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ENDSEQNO
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_EXECID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_EXECID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_EXECINST:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_EXECINST
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_EXECREFID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_EXECREFID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_HANDINST:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_HANDINST
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYIDSOURCE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYIDSOURCE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_LASTPX:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_LASTPX
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_LASTQTY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_LASTQTY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MSGSEQNUM:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MSGSEQNUM
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MSGTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MSGTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NEWSEQNO:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NEWSEQNO
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORDERID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORDERID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORDERQTY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORDERQTY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORDSTATUS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORDSTATUS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORDTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORDTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORIGCLORDID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORIGCLORDID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_POSSDUPFLAG:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_POSSDUPFLAG
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PRICE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PRICE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_REFSEQNUM:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_REFSEQNUM
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SENDERCOMPID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SENDERCOMPID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SENDERSUBID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SENDERSUBID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SENDINGTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SENDINGTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SIDE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SIDE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SYMBOL:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SYMBOL
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TARGETCOMPID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TARGETCOMPID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TARGETSUBID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TARGETSUBID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TEXT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TEXT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TIMEINFORCE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TIMEINFORCE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRANSACTTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRANSACTTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_LISTID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_LISTID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_LISTSEQNO:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_LISTSEQNO
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TOTNOORDERS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TOTNOORDERS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOORDERS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOORDERS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_POSITIONEFFECT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_POSITIONEFFECT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SIGNATURE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SIGNATURE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECUREDATALEN:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECUREDATALEN
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECUREDATA:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECUREDATA
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SIGNATURELENGTH:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SIGNATURELENGTH
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_RAWDATALENGTH:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_RAWDATALENGTH
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_RAWDATA:
                i_ret = frreport_body_l7_add_bin(p_st_sess_body
                                                , FIX_REPORT_KEY_REQ_RAWDATA
                                                , p_st_param->field_value.p_st_value->p_data
                                                , p_st_param->field_value.p_st_value->ui_len);
                break;

            case FIX_TAG_POSSRESEND:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_POSSRESEND
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ENCRYPTMETHOD:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ENCRYPTMETHOD
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_STOPPX:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_STOPPX
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CXLREJREASON:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CXLREJREASON
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORDREJREASON:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORDREJREASON
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYDESC:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYDESC
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_HEARTBTINT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_HEARTBTINT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MINQTY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MINQTY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MAXFLOOR:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MAXFLOOR
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TESTREQID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TESTREQID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ONBEHALFOFCOMPID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ONBEHALFOFCOMPID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ONBEHALFOFSUBID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ONBEHALFOFSUBID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_QUOTEID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_QUOTEID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORIGSENDINGTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORIGSENDINGTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_GAPFILLFLAG:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_GAPFILLFLAG
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_EXPIRETIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_EXPIRETIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DKREASON:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DKREASON
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DELIVERTOCOMPID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DELIVERTOCOMPID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DELIVERTOSUBID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DELIVERTOSUBID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_BIDPX:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_BIDPX
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_OFFERPX:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_OFFERPX
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_BIDSIZE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_BIDSIZE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_OFFERSIZE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_OFFERSIZE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOMISCFEES:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOMISCFEES
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MISCFEEAMT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MISCFEEAMT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MISCFEETYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MISCFEETYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PRECLOSEPX:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PRECLOSEPX
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_RESETSEQNUMFLAG:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_RESETSEQNUMFLAG
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SENDERLOCATIONID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SENDERLOCATIONID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TARGETLOCATIONID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TARGETLOCATIONID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ONBEHALFOFLOCATIONID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ONBEHALFOFLOCATIONID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DELIVERTOLOCATIONID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DELIVERTOLOCATIONID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NORELATEDSYM:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NORELATEDSYM
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_HEADLINE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_HEADLINE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_EXECTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_EXECTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_LEAVESQTY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_LEAVESQTY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CASHORDERQTY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CASHORDERQTY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ACCRUEDINTERESTAMT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ACCRUEDINTERESTAMT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_EFFECTIVETIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_EFFECTIVETIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYEXCHANGE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYEXCHANGE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MAXSHOW:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MAXSHOW
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PEGOFFSETVALUE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PEGOFFSETVALUE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ISSUEDATE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ISSUEDATE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CONTRACTMULTIPLIER:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CONTRACTMULTIPLIER
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SUBSCRIPTIONREQUESTTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SUBSCRIPTIONREQUESTTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOMDENTRIES:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOMDENTRIES
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MDENTRYTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MDENTRYTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MDENTRYPX:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MDENTRYPX
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MDENTRYSIZE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MDENTRYSIZE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MDENTRYDATE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MDENTRYDATE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MDENTRYTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MDENTRYTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MDMKT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MDMKT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MDENTRYPOSITIONNO:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MDENTRYPOSITIONNO
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CORPORATEACTION:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CORPORATEACTION
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DEFOFFERSIZE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DEFOFFERSIZE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOQUOTEENTRIES:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOQUOTEENTRIES
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOQUOTESETS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOQUOTESETS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_QUOTEACKSTATUS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_QUOTEACKSTATUS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_QUOTECANCELTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_QUOTECANCELTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_QUOTEENTRYID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_QUOTEENTRYID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_QUOTEREJECTREASON:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_QUOTEREJECTREASON
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_UNDERLYINGIDSOURCE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_UNDERLYINGIDSOURCE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_UNDERLYINGSECURITYEXCHANGE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_UNDERLYINGSECURITYEXCHANGE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_UNDERLYINGSECURITYID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_UNDERLYINGSECURITYID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_UNDERLYINGSYMBOL:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_UNDERLYINGSYMBOL
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_UNDERLYINGCURRENCY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_UNDERLYINGCURRENCY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYREQID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYREQID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYRESPONSEID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYRESPONSEID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYSTATUSREQID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYSTATUSREQID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_UNSOLICITEDINDICATOR:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_UNSOLICITEDINDICATOR
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYTRADINGSTAT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYTRADINGSTAT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESREQID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESREQID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADINGSESSIONID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADINGSESSIONID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESMETHOD:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESMETHOD
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESMODE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESMODE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESSTATUS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESSTATUS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESSTARTTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESSTARTTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESOPENTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESOPENTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESPRECLOSETIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESPRECLOSETIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESCLOSETIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESCLOSETIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESENDTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESENDTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NUMBEROFORDERS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NUMBEROFORDERS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MESSAGEENCODING:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MESSAGEENCODING
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ENCODEDTEXTLEN:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ENCODEDTEXTLEN
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ENCODEDTEXT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ENCODEDTEXT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_LASTMSGSEQNUMPROCESSED:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_LASTMSGSEQNUMPROCESSED
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ONBEHALFOFSENDINGTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ONBEHALFOFSENDINGTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_REFTAGID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_REFTAGID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_REFMSGTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_REFMSGTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SESSIONREJECTREASON:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SESSIONREJECTREASON
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_EXECRESTATEMENTREASON:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_EXECRESTATEMENTREASON
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_GROSSTRADEAMT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_GROSSTRADEAMT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MAXMESSAGESIZE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MAXMESSAGESIZE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOMSGTYPES:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOMSGTYPES
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MSGDIRECTION:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MSGDIRECTION
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOTRADINGSESSIONSS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOTRADINGSESSIONSS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TOTALVOLUMETRADED:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TOTALVOLUMETRADED
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DISCRETIONOFFSETVALUE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DISCRETIONOFFSETVALUE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TOTALNUMSECURITIES:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TOTALNUMSECURITIES
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_BIDTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_BIDTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOTRADINGSESSIONS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOTRADINGSESSIONS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PRICETYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PRICETYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CXLREJRESPONSETO:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CXLREJRESPONSETO
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PARTYIDSOURCE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PARTYIDSOURCE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PARTYID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PARTYID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PARTYROLE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PARTYROLE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOPARTYIDS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOPARTYIDS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOSECURITYALTID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOSECURITYALTID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYALTID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYALTID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYALTIDSOURCE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYALTIDSOURCE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PRODUCT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PRODUCT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CFICODE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CFICODE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TESTMESSAGEINDICATOR:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TESTMESSAGEINDICATOR
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORDERPERCENT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORDERPERCENT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PARTYSUBID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PARTYSUBID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORDERCAPACITY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORDERCAPACITY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MASSCANCELREQUESTTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MASSCANCELREQUESTTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MASSCANCELRESPONSE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MASSCANCELRESPONSE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MASSCANCELREJECTREASON:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MASSCANCELREJECTREASON
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MATURITYDATE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MATURITYDATE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_USERNAME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_USERNAME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PASSWORD:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PASSWORD
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYREQUESTRESULT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYREQUESTRESULT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ROUNDLOT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ROUNDLOT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MINTRADEVOL:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MINTRADEVOL
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADSESSTATUSREJREASON:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADSESSTATUSREJREASON
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MASSSTATUSREQID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MASSSTATUSREQID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MASSSTATUSREQTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MASSSTATUSREQTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADINGSESSIONSUBID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADINGSESSIONSUBID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOHOPS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOHOPS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_HOPCOMPID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_HOPCOMPID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_HOPSENDINGTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_HOPSENDINGTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_HOPREFID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_HOPREFID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PRICE2:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PRICE2
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYSUBTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYSUBTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NEXTEXPECTEDMSGSEQNUM:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NEXTEXPECTEDMSGSEQNUM
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORDSTATUSREQID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORDSTATUSREQID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOPARTYSUBIDS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOPARTYSUBIDS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PARTYSUBIDTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PARTYSUBIDTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PEGMOVETYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PEGMOVETYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PEGOFFSETTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PEGOFFSETTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PEGGEDPRICE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PEGGEDPRICE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PEGSCOPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PEGSCOPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DISCRETIONMOVETYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DISCRETIONMOVETYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DISCRETIONPRICE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DISCRETIONPRICE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_LASTLIQUIDITYIND:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_LASTLIQUIDITYIND
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_MISCFEEBASIS:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_MISCFEEBASIS
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_STARTDATE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_STARTDATE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ENDDATE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ENDDATE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ORDERENTRYTIME:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ORDERENTRYTIME
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ACCOUNTSECPOSITION:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ACCOUNTSECPOSITION
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DESIGNATIONINSTRUCTION:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DESIGNATIONINSTRUCTION
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NUMTRADES:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NUMTRADES
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TOTALVALUETRADED:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TOTALVALUETRADED
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_LASTPRICECHANGE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_LASTPRICECHANGE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TOTALLONGPOSITION:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TOTALLONGPOSITION
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_INDUSTRYCLASSIFICATION:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_INDUSTRYCLASSIFICATION
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SHAREFACEVALUE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SHAREFACEVALUE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_OUTSTANDINGSHARES:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_OUTSTANDINGSHARES
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PUBLICFLOATSHAREQUANTITY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PUBLICFLOATSHAREQUANTITY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PREVIOUSYEARPROFITPERSHARE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PREVIOUSYEARPROFITPERSHARE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CURRENTYEARPROFITPERSHARE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CURRENTYEARPROFITPERSHARE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_BIDLOTSIZE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_BIDLOTSIZE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ASKLOTSIZE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ASKLOTSIZE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PRICETICKSIZE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PRICETICKSIZE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PRICELIMITTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PRICELIMITTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_AUCTIONPRICELIMIT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_AUCTIONPRICELIMIT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_CONTINUOUSTRADEPRICELIMIT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_CONTINUOUSTRADEPRICELIMIT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DAILYPRICEUPLIMIT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DAILYPRICEUPLIMIT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DAILYPRICEDOWNLI:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DAILYPRICEDOWNLI
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_SECURITYPROPERTIES:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_SECURITYPROPERTIES
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NOINDICESPARTICIPATED:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NOINDICESPARTICIPATED
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_INDEXINCLUSIONINDICATOR:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_INDEXINCLUSIONINDICATOR
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PERATIO1:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PERATIO1
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PERATIO2:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PERATIO2
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NONTRADINGORDTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NONTRADINGORDTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DESIGNATIONTRANSTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DESIGNATIONTRANSTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_PARTICIPATINGINDEXID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_PARTICIPATINGINDEXID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_VOTINGPROPOSAL:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_VOTINGPROPOSAL
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_VOTINGSUBPROPOSAL:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_VOTINGSUBPROPOSAL
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_VOTINGPREFERENCE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_VOTINGPREFERENCE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DIVIDENDSELECT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DIVIDENDSELECT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_DESTSECURITY:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_DESTSECURITY
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_WARRANTSTYLE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_WARRANTSTYLE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_WARRANTPUTORCALL:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_WARRANTPUTORCALL
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_WARRANTCLEARINGTYPE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_WARRANTCLEARINGTYPE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_NAV:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_NAV
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TRADINGPHASECODE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TRADINGPHASECODE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_VALIDATIONCODE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_VALIDATIONCODE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_REQID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_REQID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TESTINST:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TESTINST
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_LISLIMIT:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_LISLIMIT
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TBBOBID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TBBOBID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TBBOASK:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TBBOASK
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ABBOBID:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ABBOBID
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ABBOASK:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ABBOASK
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_TYPEOFTRADE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_TYPEOFTRADE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            case FIX_TAG_ISPASSIVE:
                i_ret = frreport_body_l7_add_str(p_st_sess_body
                               , FIX_REPORT_KEY_REQ_ISPASSIVE
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                break;

            /* 扩展,直接上报tag */
            default:
                /* 做成key */
                p_key = (char *)frmalloc(ui_key_len);
                if (p_key == NULL)
                {
                    frreport_body_free(&p_st_sess_body);
                    return APM_L7_ANALYZE_FAIL;
                }
                snprintf(p_key, ui_key_len, "%s.fix.%u", APM_REPORT_KEY_REQ, p_st_param->ui_tag);
                i_ret = frreport_body_l7_add_str(p_st_sess_body, p_key
                               , p_st_param->field_value.p_value ? p_st_param->field_value.p_value: "");
                frfree(p_key);
                break;
        }

        if (i_ret != FR_SUCC)
        {
            frreport_body_free(&p_st_sess_body);
            return APM_L7_ANALYZE_FAIL;
        }
        p_st_node = FRLIST_NEXT_NODE(p_st_node);
    }

    /* add response start time */
    i_ret = frreport_body_l7_add_timeval(p_st_sess_body
                                        , APM_REPORT_KEY_RESP_START_TIMESTAMP
                                        , &p_st_resp->st_start_timestamp);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return FR_FAIL;
    }
    /* add response end time */
    i_ret = frreport_body_l7_add_timeval(p_st_sess_body
                                        , APM_REPORT_KEY_RESP_END_TIMESTAMP
                                        , &p_st_resp->st_end_timestamp);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return FR_FAIL;
    }

    ul_server_time_us = fix_get_interval_time(&p_st_req->st_end_timestamp
                                             , &p_st_resp->st_start_timestamp);
    /* add response response_time_us */
    i_ret = frreport_body_l7_add_ulong(p_st_sess_body
                                      , APM_REPORT_KEY_RESP_SERVER_TIME_US
                                      , ul_server_time_us);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return FR_FAIL;
    }

    ul_download_time_us = fix_get_interval_time(&p_st_resp->st_start_timestamp
                                               , &p_st_resp->st_end_timestamp);
    /* add response response_time_us */
    i_ret = frreport_body_l7_add_ulong(p_st_sess_body
                                      , APM_REPORT_KEY_RESP_DOWNLOAD_TIME_US
                                      , ul_download_time_us);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return FR_FAIL;
    }
    /* add response firstbyte time us */
    i_ret = frreport_body_l7_add_ulong(p_st_sess_body
                                      , APM_REPORT_KEY_RESP_DATA_BYTES
                                      , p_st_resp->ul_response_bytes);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return FR_FAIL;
    }

    /* error code 在fast中 */
    if (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA002) == 0
        || strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA003) == 0)
    {
        p_st_node = FRLIST_FIRST_NODE(&p_st_resp->st_param);
        while (p_st_node)
        {
            p_st_param = (Fix_param *)FRLIST_GET_NODE_DATA(p_st_node);
            switch (p_st_param->ui_tag)
            {
                case FIX_TAG_BUSINESSREJECTREASON:
                    if (l_resp_code == 0 && p_st_param->field_value.p_value)
                    {
                        l_resp_code = atol(p_st_param->field_value.p_value);
                        p_err_code = p_st_param->field_value.p_value;
                    }
                    break;

                case FIX_TAG_RESENDSTATUS:
                    if (l_resp_code == 0 && p_st_param->field_value.p_value)
                    {
                        l_resp_code = atol(p_st_param->field_value.p_value);
                        l_resp_code = (l_resp_code == 1) ? 0 : l_resp_code;
                        p_err_code = p_st_param->field_value.p_value;
                    }
                    break;

                case FIX_TAG_TEXT:
                    if (p_err_msg == NULL && p_st_param->field_value.p_value)
                    {
                        p_err_msg = p_st_param->field_value.p_value;
                    }
                    break;

                default:
                    break;
            }
        }
    }
    else
    {
        l_resp_code = atol(p_st_resp->p_err_code);
        p_err_msg = p_st_resp->p_err_msg;
        p_err_code = p_st_resp->p_err_code;
    }

    /* add response code */
    i_ret = frreport_body_l7_add_long(p_st_sess_body
                                     , APM_REPORT_KEY_RESP_CODE
                                     , l_resp_code);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return FR_FAIL;
    }
    /* add response code string */
    i_ret = frreport_body_l7_add_str(p_st_sess_body
                                     , APM_REPORT_KEY_RESP_CODE_STRING
                                     , p_err_code ? p_err_code : "");
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return FR_FAIL;
    }
    /* add response error message */
    i_ret = frreport_body_l7_add_str(p_st_sess_body, APM_REPORT_KEY_RESP_ERR_MSG
                                    , p_err_msg ? p_err_msg : "");
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        return FR_FAIL;
    }

    /* 创建report data header */
    p_st_report_data = frreport_data_l7_new(FRREPORT_TYPE_L7DATA_RESP);
    if (p_st_report_data == NULL)
    {
        frreport_body_free(&p_st_sess_body);
        return APM_L7_ANALYZE_FAIL;
    }
    /* add body into header */
    i_ret = frreport_data_add_body(p_st_report_data, p_st_sess_body);
    if (i_ret != FR_SUCC)
    {
        frreport_body_free(&p_st_sess_body);
        frreport_data_free(&p_st_report_data);
        return APM_L7_ANALYZE_FAIL;
    }

    /* 上报request数据 */
    i_ret = frreport_data_hash(p_st_hash_report, p_st_report_data);
    if (i_ret != FR_SUCC)
    {
        frreport_data_free(&p_st_report_data);
        return APM_L7_ANALYZE_FAIL;
    }

    return APM_L7_ANALYZE_SET_RESP(APM_L7_ANALYZE_SUCC);
}

/*******************************************************************************
*  FUNC     :  解析response
*  ARGS     :  p_st_conn(入力链接信息)
*           :  p_st_private(私有session数据)
*           :  p_st_hash_report(保存Frreport_data)
*  RTN      :  APM_L7_ANALYZE_FAIL      (FAIL)
*              APM_L7_ANALYZE_TODO      (More data)
*              APM_L7_ANALYZE_SUCC      (SUCC)
*  NOTE     :
*******************************************************************************/
int fix_parse_response(Conntrack *p_st_conn
                      , L7session_fix_private *p_st_private
                      , Frhash_header *p_st_hash_report)
{
    int i_ret = APM_L7_ANALYZE_SUCC;
    /* 没有请求当做行情网关下发 */
    if (p_st_private->p_st_req == NULL)
    {
        i_ret = fix_parse_broadcast(p_st_conn, p_st_private, p_st_hash_report);
        return i_ret;
    }

    unsigned int ui_first = 0;
    unsigned int ui_tag = 0;
    unsigned int ui_loop = 0;
    unsigned int ui_loop_loop = 1;
    unsigned int ui_secure_data_len = 0;
    unsigned int ui_signa_ture_length = 0;
    unsigned int ui_raw_data_length = 0;
    unsigned int ui_encoded_text_length = 0;
    unsigned int arr_deep[FIX_MAX_DEEP] = {0};
    char *p_value = NULL;
    char *p_pamp = NULL;
    char *p_input_msg = NULL;
    unsigned int ui_pmap_size = 0;
    L7_resp_fix *p_st_resp = NULL;
    L7_req_fix *p_st_req = p_st_private->p_st_req;
    L7session_fix *p_st_sess = p_st_private->p_st_sess;
    L7_fragment_fix *p_st_fragment = p_st_private->p_st_fragment;
    char *p_inbuff = p_st_fragment->p_input_msg + p_st_fragment->ui_hd_len;
    unsigned int ui_bd_len = p_st_fragment->ui_bd_len;
    unsigned int ui_fix_len = p_st_fragment->ui_hd_len + ui_bd_len + FIX_SHO_LEN;
    Frreport_data *p_st_report_data=NULL;
    char arr_info[128] = {0};

    /* 做成response */
    if (p_st_private->p_st_resp == NULL)
    {
        p_st_private->p_st_resp = (L7_resp_fix *)frmalloc(sizeof(L7_resp_fix));
        if (p_st_private->p_st_resp == NULL)
        {
            return APM_L7_ANALYZE_FAIL;
        }
        memset(p_st_private->p_st_resp, 0x0, sizeof(L7_resp_fix));
        p_st_private->p_st_resp->st_start_timestamp = p_st_fragment->st_start_timestamp;
    }
    p_st_resp = p_st_private->p_st_resp;

    /* login */
    if (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_LOGON) == 0)
    {
        if (p_st_sess->p_user_name)
        {
            snprintf(arr_info, sizeof(arr_info), "%s login", p_st_sess->p_user_name);
        }
        else
        {
            snprintf(arr_info, sizeof(arr_info), "login");
        }
        /* 不解析不上报 */
        if (strcasecmp(p_st_fragment->p_msg_type, FIX_MSG_TP_REJECT) == 0)
        {
            p_st_report_data = frreport_update_create(p_st_conn
                                                     , APM_REPORT_UPDATE_LOGON_REJECT
                                                     , arr_info, &p_st_fragment->st_end_timestamp);
        }
        else
        {
            p_st_report_data = frreport_update_create(p_st_conn
                                                     , APM_REPORT_UPDATE_LOGON
                                                     , arr_info, &p_st_fragment->st_end_timestamp);
            p_st_sess->st_login = p_st_fragment->st_end_timestamp;
        }
        if (p_st_report_data)
        {
            i_ret = frreport_send(g_p_apm_context, &p_st_report_data);
            if (i_ret != FR_SUCC)
            {
                return APM_L7_ANALYZE_FAIL;
            }
        }
        fix_destroy_curr_info(p_st_private);
        return APM_L7_ANALYZE_SUCC;
    }
    else if (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_HEARTBEAT) == 0
        || strcmp(p_st_req->p_msg_type, FIX_MSG_TP_TEST_REQ) == 0
        || strcmp(p_st_req->p_msg_type, FIX_MSG_TP_RESEND_REQ) == 0
        || strcmp(p_st_req->p_msg_type, FIX_MSG_TP_SEQUENCE_REQ) == 0
        || strcmp(p_st_req->p_msg_type, FIX_MSG_TP_LOGOUT) == 0)
    {
        /* 不解析不上报 */
        fix_destroy_curr_info(p_st_private);
        return APM_L7_ANALYZE_SUCC;
    }

    while (ui_bd_len)
    {
        i_ret = fix_get_tag(&p_inbuff, &ui_bd_len, &ui_tag);
        if (i_ret != FR_SUCC)
        {
            frdbg("get tag failed");
            return APM_L7_ANALYZE_FAIL;
        }

        switch (ui_tag)
        {
            case FIX_TAG_SECUREDATALEN:         // 密文数据长度
                i_ret = fix_get_value(&p_inbuff, &ui_bd_len, &p_value);
                if (i_ret != FR_SUCC)
                {
                    return APM_L7_ANALYZE_FAIL;
                }
                i_ret = fix_atoui(p_value, &ui_secure_data_len);
                fix_free((char **)&p_value);
                break;

            case FIX_TAG_MSGSEQNUM:             // 消息序号（可加密）
            case FIX_TAG_SENDERSUBID:           // 发送方子标识符（可加密）
            case FIX_TAG_SENDERLOCATIONID:      // 发送方方位标识符（可加密）
            case FIX_TAG_TARGETSUBID:           // 接收方子标识符（可加密）
            case FIX_TAG_TARGETLOCATIONID:      // 接收方方位标识符（可加密）
            case FIX_TAG_ONBEHALFOFSUBID:       // 最初发送方子标识符（可加密）
            case FIX_TAG_ONBEHALFOFLOCATIONID:  // 最初发送方方位标识符（可加密）
            case FIX_TAG_DELIVERTOSUBID:        // 最终接收方子标识符（可加密）
            case FIX_TAG_DELIVERTOLOCATIONID:   // 最终接收方方位标识符（可加密）
            case FIX_TAG_POSSDUPFLAG:           // 可能重复标志，重复发送时，作此标记（可加密）
            case FIX_TAG_POSSRESEND:            // 可能重发标志（可加密）
            case FIX_TAG_SENDINGTIME:           // 发送时间（可加密）
            case FIX_TAG_ORIGSENDINGTIME:       // 原始发送时间（可加密）
            case FIX_TAG_MESSAGEENCODING:       // 消息中Encoded域的字符编码类型（非ASCII 码）
            case FIX_TAG_LASTMSGSEQNUMPROCESSED:// 最后处理消息序号（可加密）
            case FIX_TAG_ONBEHALFOFSENDINGTIME: // 最初发送时间（用UTC 表示时间）
            case FIX_TAG_NOHOPS:                //历史跳跃信息重复组(以下三个的重复次数)
            case FIX_TAG_HOPCOMPID:             // 取值第三方的SenderCompID
            case FIX_TAG_HOPSENDINGTIME:        // 取值用第三方的SendingTime
            case FIX_TAG_HOPREFID:              // 取值第三方的MsgSeqNum
                i_ret = fix_skip_value(&p_inbuff, &ui_bd_len);
                break;

            /* 以下为message tail，不上报 */
            case FIX_TAG_SIGNATURELENGTH:       // 数字签名长度（不可加密）
                i_ret = fix_get_value(&p_inbuff, &ui_bd_len, &p_value);
                if (i_ret != FR_SUCC)
                {
                    return APM_L7_ANALYZE_FAIL;
                }
                i_ret = fix_atoui(p_value, &ui_signa_ture_length);
                fix_free((char **)&p_value);
                break;

            case FIX_TAG_SIGNATURE:             // 数字签名（不可加密）
                i_ret = fix_skip_value2(&p_inbuff, &ui_bd_len, ui_signa_ture_length);
                break;

            case FIX_TAG_CHECKSUM:              // 校验和，消息的最末域（不可加密）
                i_ret = fix_skip_value(&p_inbuff, &ui_bd_len);
                break;

            case FIX_TAG_RAWDATALENGTH:        // 无格式数据长度
                i_ret = fix_get_value(&p_inbuff, &ui_bd_len, &p_value);
                if (i_ret != FR_SUCC)
                {
                    return APM_L7_ANALYZE_FAIL;
                }
                i_ret = fix_atoui(p_value, &ui_raw_data_length);
                fix_free((char **)&p_value);
                break;

            case FIX_TAG_RAWDATA:              // 无格式数据
                if (ui_raw_data_length + 1 > ui_bd_len)
                {
                    return APM_L7_ANALYZE_FAIL;
                }

                if (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA002) == 0)
                {
                    i_ret = fix_fast_init_szse_ua002(&p_st_sess->st_ua002);
                    if (i_ret != FR_SUCC)
                    {
                        return APM_L7_ANALYZE_FAIL;
                    }
                    ui_bd_len -= ui_raw_data_length + 1;
                    while (ui_raw_data_length)
                    {
                        p_pamp = p_inbuff;
                        i_ret = fix_fast_get_pamp(&p_inbuff
                                                 , &ui_raw_data_length
                                                 , &ui_pmap_size);
                        if (i_ret != FR_SUCC)
                        {
                            return APM_L7_ANALYZE_FAIL;
                        }
                        ui_first = arr_deep[0] + 1;
                        memset(arr_deep, 0,  sizeof(arr_deep));
                        arr_deep[0] = ui_first;
                        ui_loop = 0;
                        ui_loop_loop = 1;
                        i_ret = fix_fast_parse_raw(&p_inbuff
                                                  , &ui_raw_data_length
                                                  , &p_st_sess->st_ua002
                                                  , &p_st_req->st_param
                                                  , arr_deep, 0
                                                  , p_pamp, ui_pmap_size
                                                  , &ui_loop, &ui_loop_loop);
                        if (i_ret != FR_SUCC)
                        {
                            return APM_L7_ANALYZE_FAIL;
                        }
                    }
                    fix_fast_mod_reset(&p_st_sess->st_ua002);
                    p_inbuff++;
                }
                else if (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_REJECT_J) == 0)
                {
                    i_ret = fix_fast_init_szse_j(&p_st_sess->st_j);
                    if (i_ret != FR_SUCC)
                    {
                        return APM_L7_ANALYZE_FAIL;
                    }
                    ui_bd_len -= ui_raw_data_length + 1;
                    while (ui_raw_data_length)
                    {
                        p_pamp = p_inbuff;
                        i_ret = fix_fast_get_pamp(&p_inbuff
                                                 , &ui_raw_data_length
                                                 , &ui_pmap_size);
                        if (i_ret != FR_SUCC)
                        {
                            return APM_L7_ANALYZE_FAIL;
                        }
                        ui_first = arr_deep[0] + 1;
                        memset(arr_deep, 0,  sizeof(arr_deep));
                        arr_deep[0] = ui_first;
                        ui_loop = 0;
                        ui_loop_loop = 1;
                        i_ret = fix_fast_parse_raw(&p_inbuff
                                                  , &ui_raw_data_length
                                                  , &p_st_sess->st_j
                                                  , &p_st_req->st_param
                                                  , arr_deep, 0
                                                  , p_pamp, ui_pmap_size
                                                  , &ui_loop, &ui_loop_loop);
                        if (i_ret != FR_SUCC)
                        {
                            return APM_L7_ANALYZE_FAIL;
                        }
                    }
                    fix_fast_mod_reset(&p_st_sess->st_j);
                    p_inbuff++;
                }
                else
                {
                    i_ret = fix_skip_value2(&p_inbuff, &ui_bd_len, ui_raw_data_length + 1);
                    //i_ret = fix_get_value2(&p_inbuff, &ui_bd_len, &p_value, ui_raw_data_length);
                    //if (i_ret != FR_SUCC)
                    //{
                    //    return APM_L7_ANALYZE_FAIL;
                    //}
                    ///* 创建param节点 */
                    //i_ret = fix_create_node(ui_tag, &p_value, ui_signa_ture_length, &p_st_req->st_param);
                }
                break;

            case FIX_TAG_ENCODEDTEXTLEN:        // 编码文本长度
                i_ret = fix_get_value(&p_inbuff, &ui_bd_len, &p_value);
                if (i_ret != FR_SUCC)
                {
                    return APM_L7_ANALYZE_FAIL;
                }
                i_ret = fix_atoui(p_value, &ui_encoded_text_length);
                fix_free((char **)&p_value);
                break;

            case FIX_TAG_ENCODEDTEXT:              // 编码文本（非ASCII 码）
                i_ret = fix_skip_value2(&p_inbuff, &ui_bd_len, ui_encoded_text_length);
                break;

            case FIX_TAG_CXLREJREASON:
            case FIX_TAG_ORDREJREASON:
            case FIX_TAG_QUOTE_REQ_REJECT_RESAON:
            case FIX_TAG_QUOTEREJECTREASON:
            case FIX_TAG_TRADE_REP_REJECT_RESAON:
            case FIX_TAG_BUSINESSREJECTREASON:
                i_ret = fix_get_value(&p_inbuff, &ui_bd_len, &p_value);
                if (i_ret != FR_SUCC)
                {
                    return APM_L7_ANALYZE_FAIL;
                }
                if (p_value)
                {
                    fix_free((char **)&p_st_resp->p_err_code);
                    p_st_resp->p_err_code = p_value;
                    p_value = NULL;
                }
                break;

            case FIX_TAG_REJECT_TEXT:
            case FIX_TAG_TEXT:
                i_ret = fix_get_value(&p_inbuff, &ui_bd_len, &p_value);
                if (i_ret != FR_SUCC)
                {
                    return APM_L7_ANALYZE_FAIL;
                }
                if (p_value)
                {
                    fix_free((char **)&p_st_resp->p_err_msg);
                    p_st_resp->p_err_msg = p_value;
                    p_value = NULL;
                }
                break;

            /* 其他体部字段不上报 */
            default:
                i_ret = fix_skip_value(&p_inbuff, &ui_bd_len);
                break;
        }

        if (i_ret != FR_SUCC)
        {
            fix_free((char **)&p_value);
            return APM_L7_ANALYZE_FAIL;
        }
    }

    /* 查看是否还有未解析的部分 */
    if (p_st_fragment->ui_input_size > ui_fix_len)
    {
        /* 不是重传的都当做只有一个完整的FIX */
        if (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA002) != 0
            || (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_B) != 0
               && strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA201) != 0
               && strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA202) != 0))
        {
            return APM_L7_ANALYZE_FAIL;
        }
        /* do next */
        else
        {
            if (p_st_fragment->i_new_flg == FR_NO)
            {
                p_input_msg = (char *)frmalloc(p_st_fragment->ui_input_size + 1);
                if (p_input_msg == NULL)
                {
                    return APM_L7_ANALYZE_FAIL;
                }
                p_st_fragment->i_new_flg = FR_YES;
                memcpy(p_input_msg, p_inbuff + FIX_SHO_LEN
                      , p_st_fragment->ui_input_size - ui_fix_len);
                p_input_msg[p_st_fragment->ui_input_size - ui_fix_len] = '\0';
                p_st_fragment->ui_hd_len = 0;
                p_st_fragment->ui_bd_len = 0;
                p_st_fragment->ui_input_size -= ui_fix_len;
                p_st_fragment->ui_mem_size = p_st_fragment->ui_input_size + 1;
                p_st_fragment->p_input_msg = p_input_msg;
            }
            else
            {
                p_st_fragment->ui_hd_len = 0;
                p_st_fragment->ui_bd_len = 0;
                memmove(p_st_fragment->p_input_msg
                        , p_st_fragment->p_input_msg + ui_fix_len
                        , p_st_fragment->ui_input_size - ui_fix_len + 1);
                p_st_fragment->ui_input_size -= ui_fix_len;
            }
            fix_free((char **)&p_st_fragment->p_msg_type);
            return APM_L7_ANALYZE_TODO;
        }
    }

    /* 重传请求要当行情网关也发送重传请求请求过来才算结束 */
    if (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA002) == 0)
    {
        if (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_B) == 0
            || strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA201) == 0
            || strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA202) == 0)
        {
            return APM_L7_ANALYZE_TODO;
        }
        else if (strcmp(p_st_req->p_msg_type, FIX_MSG_TP_UA202) != 0
                 && strcmp(p_st_req->p_msg_type, FIX_MSG_TP_REJECT_J) != 0)
        {
            return APM_L7_ANALYZE_FAIL;
        }
    }

    i_ret = __fix_report_resp(p_st_conn, p_st_private, p_st_hash_report);
    fix_destroy_curr_info(p_st_private);
    return i_ret;
}
